﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title>配置机构消息模板</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link href="/lobsteruiframe/layuiadmin/layui/css/layui.css" rel="stylesheet" />
    <link href="/lobsteruiframe/layuiadmin/style/admin.css" rel="stylesheet" />
    <script src="/lobsteruiframe/layuiadmin/layui/layui.js"></script>
    <script src="/jslib/jquery-3.4.1.min.js"></script>
    <script src="/jslib/lobster.js"></script>
</head>
<body>
    <div class="layui-fluid">
        <form class="layui-form">
            <div class="layui-card">
                <div class="layui-card-header layui-form layuiadmin-card-header-auto">
                    <div class="layui-inline">
                        <div class="layui-form-item">
                            <label class="layui-form-label">机构：</label>
                            <div class="layui-input-block">
                                <select name="workId" id="workId" lay-filter="workId"></select>
                            </div>
                        </div>
                    </div>
                    <div class="layui-inline">
                        <div class="layui-form-item">
                            <label class="layui-form-label">应用：</label>
                            <div class="layui-input-block">
                                <select name="AppId" id="AppId" lay-filter="AppId"></select>
                            </div>
                        </div>
                    </div>
                    <div class="layui-inline">
                        <div class="layui-form-item">
                            <label class="layui-form-label">类型：</label>
                            <div class="layui-input-block">
                                <select name="SysCode" id="SysCode" lay-filter="SysCode"></select>
                            </div>
                        </div>
                    </div>
                    <div class="layui-inline">
                        <div class="layui-form-item">
                            <label class="layui-form-label">模板标题：</label>
                            <div class="layui-input-block">
                                <input type="text" class="layui-input" id="txtMessageContent" name="txtMessageContent" placeholder="请输入消息模板标题" />
                            </div>
                        </div>
                    </div>
                    <div class="layui-inline">
                        <div class="layui-form-item">
                            <button class="layui-btn layuiadmin-btn-useradmin" lay-submit lay-filter="query-submit">
                                <i class="layui-icon layuiadmin-button-btn layui-icon-search"></i>查询
                            </button>
                        </div>
                    </div>
                </div>
                <div class="layui-card-body">
                   
                    <table class="layui-table" id="gridMessageTemplate" lay-filter="gridMessageTemplate"></table>
                </div>
            </div>
        </form>
    </div>
</body>
</html>

<script type="text/javascript">
    lobsterlayui.main(['index', 'layer', 'form', 'element', 'table'], {
        data: {
            $layui: null,
            right: null,
            tablemsg:null,
        },
        pageload: function (right) {
            this.data.right = right;
            this.loadselectworker(() => {
                this.loadselectapp(() => {
                    this.loadselectmsgtype(() => {
                       this.data.tablemsg= this.InitDataGrid();
                    })
                })
            })
            this.initevent();
        },
        initevent() {
            var self = this;
            // 点击查询按钮查询消息类型
            layui.form.on("submit(query-submit)", function (obj) {
                var load = layer.msg('正在处理，请稍候', { icon: 16, time: 0, shade: [0.3, '#393D49'] });
                self.data.tablemsg.reload({
                    where: {
                        appId: $("#AppId").val(),
                        workId: $("#workId").val(),
                        sysCode: $("#SysCode").val(),
                        msgContent: $("#txtMessageContent").val()
                    },
                    page: {
                        curr: 1 //重新从第 1 页开始
                    },
                    done: function () {
                        layer.close(load);
                    }
                });
                return false;
            });

                    // 监听行工具事件
            layui.table.on("tool(gridMessageTemplate)", function (obj) {
                var data = obj.data;
                var tr = obj.tr;
                if (obj.event === "alter") {
                    // 修改消息类型
                    var index = layer.open({
                        type: 1,
                        title: "编辑消息模板",
                        btn: ["保存", "取消"],
                        btnAlign: "r",
                        content: $('#dlg_msgform').html(),
                        area: ["750px", "90%"],
                        success: function (layero, index) {
                            var othis = $("#formMsgType");

                            othis.find('input[name="TempId"]').val(data.TempId);
                            othis.find('input[name="AppId"]').val(data.AppId);
                            othis.find('input[name="WorkId"]').val(data.WorkId);
                            othis.find('input[name="SysCode"]').val(data.SysCode);
                            othis.find('input[name="TempCode"]').attr("disabled", true);
                            othis.find('input[name="TempName"]').attr("disabled", true);
                            othis.find('input[name="SysTemplate"]').attr("disabled", true);

                            othis.find('input[name="TempCode"]').val(data.TempCode);
                            othis.find('input[name="TempName"]').val(data.TempName);
                            othis.find('textarea[name="SysTemplate"]').val(data.SysTemplate);
                            othis.find('input[name="UrlTemplate"]').val(data.UrlTemplate);
                            othis.find('select[name="UserType"]').val(data.UserType);
                            othis.find('select[name="SysCode"]').val(data.SysCode);
                            othis.find('input[name="SmsTemplateId"]').val(data.SmsTemplateId);
                            othis.find('input[name="WeixinTemplateId"]').val(data.WeixinTemplateId);
                            othis.find('input[name="WeixinFrist"]').val(data.WeixinFrist);
                            othis.find('input[name="WeixinRemark"]').val(data.WeixinRemark);

                            othis.find('input[name="MessageParams"]').val(data.MessageParams);
                            othis.find('input[name="WxParams"]').val(data.WxParams);
                            if (data.MessageSwitch == 1)
                                othis.find('input[name="MessageSwitch"]').attr("checked", true);
                            if (data.WxSwitch == 1)
                                othis.find('input[name="WxSwitch"]').attr("checked", true);
                            //小程序模板
                            othis.find('input[name="AppletTemplateParams"]').val(data.AppletTemplateParams);
                            othis.find('input[name="AppletTemplateId"]').val(data.AppletTemplateId);
                            othis.find('input[name="AppletTitle"]').val(data.AppletTitle);
                            othis.find('input[name="AppletRemark"]').val(data.AppletRemark);
                            othis.find('input[name="AppletUrl"]').val(data.AppletUrl);
                            if (data.AppletSwitch == 1)
                                othis.find('input[name="AppletSwitch"]').attr("checked", true);
                            othis.find('input[name="PushTemplateId"]').val(data.PushTemplateId);
                            if (data.PushSwitch == 1)
                                othis.find('input[name="PushSwitch"]').attr("checked", true);
                            layui.form.render("checkbox");

                        },
                        yes: function (index, layero) {
                            var submit = $("#btnSubmit");
                            //监听提交
                            layui.form.on("submit(btnSubmit)", function (formdata) {
                                self.SaveTemplate(formdata, index);
                            });
                            submit.trigger("click");
                        },
                        btn2: function (index, layero) {
                            tr.removeAttr("class");
                        },
                        cancel: function () {
                            tr.removeAttr("class");
                        }
                    });
                }
                else if (obj.event === "alterPush") {
                    // window.currentData = { currentTempId: data.TempId, currentPushTemplateId: data.PushTemplateId };
                    layer.open({
                        type: 1,
                        title: "编辑消息推送模板",
                        btn: ["保存", "取消"],
                        btnAlign: "r",
                        content: $('#dlg_msgpushform').html(),
                        area: ["680px", "90%"],
                        success: function (layero, index) {
                            var othis = $("#formPushTemplate");
                            othis.find('input[name="WorkId"]').val(data.WorkId);
                            self.getPushTemplate(data.PushTemplateId);
                        },
                        yes: function (index, layero) {
                            var submit = $("#btnSubmit");
                            //监听提交
                            layui.form.on("submit(btnSubmit)", function (formdata) {
                                self.savePushTemplate(formdata,data.TempId,data.PushTemplateId);
                            });
                            submit.trigger("click");
                        },
                        btn2: function (index, layero) {
                            tr.removeAttr("class");
                        },
                        cancel: function () {
                            tr.removeAttr("class");
                        }
                    });
                }
                else if (obj.event === 'enabled') {
                    layer.confirm("确定要启用吗?", { icon: 3, title: "提示" },
                        function (index) {
                            layer.close(index); //关闭弹层
                            data.WorkId = $("#workId").val();

                            lobsterlayui.POST('/admin/v1/workermsg/EnabledBaseMessageTemplate',data).then(retdata=>{
                                layer.msg("启用成功");
                                self.data.tablemsg.reload();
                            })
                        });
                }
            });
        },
        loadselectworker(callback){
            //获取机构数据
            lobsterlayui.GET('/admin/v1/worker/GetSelectWorkerDataByUser').then(data => {
                //医疗机构
                var workers = data["Workers"];
                $("#workId").html("");
                $.each(workers, function (i, item) {
                    $("#workId").append("<option value=\"" + item.WorkId + "\">" + item.WorkName + "</option>");
                });

                $('#workId').val(workers[0].WorkId);//默认选择当前登录机构
                //重新渲染
                layui.form.render("select");

                if (callback) {
                    callback();
                }
            });

            //监听机构下拉框
            layui.form.on('select(workId)', function () {
                if (callback) {
                    callback();
                }
            });
        },
        //加载应用
        loadselectapp : function (callback) {

            lobsterlayui.GET('/admin/v1/worker/GetSimpleAppData',{workid:$('#workId').val()}).then(retdata=>{
                 //应用列表
                 var appdata = retdata["appdata"];
                    $("#AppId").html("");
                    $.each(appdata, function (i, item) {
                        $("#AppId").append("<option value=\"" + item.AppId + "\">" + item.AppName + "</option>");
                    });
                    //重新渲染
                    layui.form.render("select");

                    if (callback) {
                        callback();
                    }
            })

            //监听应用下拉框
            layui.form.on('select(AppId)', function () {
                if (callback) {
                    callback();
                }
            });
        },
        loadselectmsgtype : function (callback) {
            lobsterlayui.GET('/admin/v1/workermsg/GetSimpleMessageType',{appId:$('#AppId').val()}).then(retdata=>{
                //应用列表
                var typedata = retdata["dt"];
                $("#SysCode").html("");
                $.each(typedata, function (i, item) {
                    $("#SysCode").append("<option value=\"" + item.Code + "\">" + item.Name + "</option>");
                });
                //重新渲染
                layui.form.render("select");

                if (callback) {
                    callback();
                }
            })
            
            //监听应用下拉框
            layui.form.on('select(SysCode)', function () {
                if (callback) {
                    callback();
                }
            });
        },
        InitDataGrid(){
            return layui.table.render({
                elem: "#gridMessageTemplate",
                headers:lobsterlayui.GetHeaderData(),
                where: {
                    appId: $("#AppId").val(),
                    workId: $("#workId").val(),
                    sysCode: $("#SysCode").val(),
                    msgContent: $("#txtMessageContent").val()
                },
                height: "full-140",
                cellMinWidth: 80, //全局定义常规单元格的最小宽度
                url: "/admin/v1/workermsg/GetBaseTemplateConfigList", //数据接口
                page: true, //开启分页
                //size: "sm",
                //even: true,
                loading: true,
                cols: [[ //表头
                    { field: 'TempId', hide: true },
                    { field: "Name", width: "100", title: "消息类型" },
                    { field: 'TempCode', width: "80", title: "编码" },
                    { field: "TempName", width: "200", title: "模板标题" },
                    { field: "SysTemplate", width: "400", title: "模板内容" },
                    { field: "MessageSwitch", width: "100", title: "短信开关", templet: "#MessageSwitch" },
                    { field: "WxSwitch", width: "100", title: "微信开关", templet: "#WxSwitch" },
                    { field: "AppletSwitch", width: "100", title: "小程序开关", templet: "#AppletSwitch" },
                    { field: "PushSwitch", width: "100", title: "推送开关", templet: "#PushSwitch" },
                    { title: "操作", width: "220", align: 'center', toolbar: "#barRowMessageTemplate", fixed: "right" },
                ]],
                parseData: function (res) {
                    return {
                        code: res.code,
                        msg: res.msg,
                        count: res.data.count,
                        data: res.data.dt
                    }
                }
            });
        },
        SaveTemplate(formdata){
            var self=this;
            var data = formdata.field;
            if (data.MessageSwitch == "on")
                data.MessageSwitch = 1;
            else
                data.MessageSwitch = 0;

            if (data.WxSwitch == "on")
                data.WxSwitch = 1;
            else
                data.WxSwitch = 0;

            if (data.PushSwitch == "on")
                data.PushSwitch = 1;
            else
                data.PushSwitch = 0;

            var load = layer.msg('正在处理，请稍候', { icon: 16, time: 0, shade: [0.3, '#393D49'] });
            lobsterlayui.POST('/admin/v1/workermsg/SaveBaseTemplateConfig',data).then(retdata=>{
                layer.msg("操作成功");
                layer.closeAll();
                self.data.tablemsg.reload();
            })
        },
        savePushTemplate(formdata,currentTempId,currentPushTemplateId){
            var self=this;
            formdata.field.PushTemplateId=currentPushTemplateId;
            formdata.field.TempId=currentTempId;
            var load = layer.msg('正在处理，请稍候', { icon: 16, time: 0, shade: [0.3, '#393D49'] });
            lobsterlayui.POST('/admin/v1/workermsg/SavePushMessageTemplate?tempId='+currentTempId,formdata.field).then(retdata=>{
                layer.msg("保存成功");
                layer.closeAll();
                self.data.tablemsg.reload();
            })
        },
        getPushTemplate : function (currentPushTemplateId) {
            if(currentPushTemplateId==0)return;
            lobsterlayui.GET('/admin/v1/workermsg/GetPushMessageTemplate',{pushTemplateId:currentPushTemplateId}).then(retdata=>{
                var data = retdata["template"];
                var othis = $("#formPushTemplate");
                othis.find('[name="AppId"]').val(data.AppId);
                othis.find('[name="Title"]').val(data.Title);
                othis.find('[name="Body"]').val(data.Body);
                othis.find('[name="Payload"]').val(data.Payload);
                othis.find('[name="ClickType"]').val(data.ClickType);
                othis.find('[name="Intent"]').val(data.Intent);
                othis.find('[name="Url"]').val(data.Url);
                othis.find('[name="BadgeAddNum"]').val(data.BadgeAddNum);
                othis.find('[name="PackageName"]').val(data.PackageName);
            });
        }
    })
</script>

<script type="text/html" id="barRowMessageTemplate">
    {{# if(d.TempId==0){ }}
    <a class="layui-btn layui-btn-xs" lay-event="enabled"><i class="layui-icon layui-icon-edit"></i>启用</a>
    {{# } else { }}
    <a class="layui-btn layui-btn-xs" lay-event="alter"><i class="layui-icon layui-icon-edit"></i>编辑</a>
    <a class="layui-btn layui-btn-xs" lay-event="alterPush"><i class="layui-icon layui-icon-edit"></i>编辑推送模板</a>
    {{# } }}
</script>
<script type="text/html" id="MessageSwitch">
    {{# if(d.MessageSwitch==1){ }}
    <span style="color:red;">开启</span>
    {{# } else { }}
    <span>关闭</span>
    {{# } }}
</script>
<script type="text/html" id="WxSwitch">
    {{# if(d.WxSwitch==1){ }}
    <span style="color:red;">开启</span>
    {{# } else { }}
    <span>关闭</span>
    {{# } }}
</script>
<script type="text/html" id="PushSwitch">
    {{# if(d.PushSwitch==1){ }}
    <span style="color:red;">开启</span>
    {{# } else { }}
    <span>关闭</span>
    {{# } }}
</script>
<script type="text/html" id="AppletSwitch">
    {{# if(d.AppletSwitch==1){ }}
    <span style="color:red;">开启</span>
    {{# } else { }}
    <span>关闭</span>
    {{# } }}
</script>

<script type="text/html" id="dlg_msgform">
    <div class="layui-fluid box">
        <form class="layui-form" lay-filter="formMsgType" id="formMsgType" style="padding: 0px 0px 0 0;">
            <div class="layui-card">
                <div class="layui-card-body box">
                    <div class="layui-form-item layui-hide">
                        <input type="text" id="TempId" name="TempId" value="0" />
                        <input type="text" id="txtappId" name="AppId" value="0" />
                        <input type="text" id="txtworkId" name="WorkId" value="0" />
                        <input type="text" id="txtsysCode" name="SysCode" value="0" />
                    </div>
                    <div class="layui-form-item active">
                        <label class="layui-form-label"><i style="color:red;">*&ensp; </i>模板编码</label>
                        <div class="layui-input-inline">
                            <input type="text" required lay-verify="required" class="layui-input" id="TempCode" name="TempCode" disabled/>
                        </div>
                        <label class="layui-form-label"><i style="color:red;">*&ensp; </i>模板标题</label>
                        <div class="layui-input-inline">
                            <input type="text" required lay-verify="required" class="layui-input" id="TempName" name="TempName" disabled/>
                        </div>
                    </div>
                    <div class="layui-form-item active">
                        <label class="layui-form-label"><i style="color:red;">*&ensp; </i>模板内容</label>
                        <div class="layui-input-block">
                            <textarea style="width: 499px; height: 119px;" required lay-verify="required" type="text" disabled
                                      id="SysTemplate" name="SysTemplate" placeholder="例如：已收到{某某}的统领单药单(单号：{123456})，请及时处理"></textarea>
                        </div>
                    </div>
   
                    <fieldset class="layui-elem-field">
                        <legend>短信</legend>
                        <div class="layui-field-box">
                            <div class="layui-form-item active">
                                <label class="layui-form-label">短信开关</label>
                                <div class="layui-input-inline">
                                    <input type="checkbox" name="MessageSwitch" id="MessageSwitch" lay-skin="primary">
                                </div>
                            </div>
                            <div class="layui-form-item active">
                                <label class="layui-form-label">短信模板ID</label>
                                <div class="layui-input-inline">
                                    <input type="text" class="layui-input" id="SmsTemplateId" name="SmsTemplateId" placeholder="腾讯云短信模板ID" />
                                </div>
                            </div>
                            <div class="layui-form-item active">
                                <label class="layui-form-label">短信模板</label>
                                <div class="layui-input-block">
                                    <input class="layui-input" id="MessageParams" name="MessageParams" placeholder="例如：已收到{某某}的统领单药单(单号：{123456})，请及时处理" />
                                </div>
                            </div>
                        </div>
                    </fieldset>
   
                    <fieldset class="layui-elem-field ">
                        <legend>微信公众号</legend>
                        <div class="layui-field-box">
                            <div class="layui-form-item active">
                                <label class="layui-form-label">微信开关</label>
                                <div class="layui-input-inline">
                                    <input type="checkbox" name="WxSwitch" id="WxSwitch" lay-skin="primary">
                                </div>
                                
                            </div>
                            <div class="layui-form-item active">
                                <label class="layui-form-label">微信模板ID</label>
                                <div class="layui-input-inline">
                                    <input type="text" class="layui-input" id="WeixinTemplateId" name="WeixinTemplateId" placeholder="微信公众号消息模板ID" />
                                </div>
                            </div>
                            <div class="layui-form-item active">
                                <label class="layui-form-label">微信模板</label>
                                <div class="layui-input-block">
                                    <input class="layui-input" id="WxParams" name="WxParams" placeholder="例如：已收到{某某}的统领单药单(单号：{123456})，请及时处理" />
                                </div>
                            </div>
                            <div class="layui-form-item active">
                                <label class="layui-form-label">微信标题</label>
                                <div class="layui-input-block">
                                    <input type="text" style="width: 499px;" class="layui-input" id="WeixinFrist" name="WeixinFrist" placeholder="您好，您已成功预约了视频问诊，请立即前往候诊大厅。" />
                                </div>
                            </div>
                            <div class="layui-form-item active">
                                <label class="layui-form-label">微信备注</label>
                                <div class="layui-input-block">
                                    <input type="text" style="width: 499px;" class="layui-input" id="WeixinRemark" name="WeixinRemark" placeholder="立即进入" />
                                </div>
                            </div>
                            <div class="layui-form-item active">
                                <label class="layui-form-label">微信链接</label>
                                <div class="layui-input-block">
                                    <input type="text" style="width: 499px;" class="layui-input" id="UrlTemplate" name="UrlTemplate"
                                           placeholder="/pages/videomedical/writemedicaldata/askreply/index?docId={医生编号}&contentId={问题单编号}&patientId={患者编号}" />
                                </div>
                            </div>
                        </div>
                    </fieldset>
   
   
                    <fieldset class="layui-elem-field">
                        <legend>小程序通知</legend>
                        <div class="layui-field-box">
                            <div class="layui-form-item active">
                                <label class="layui-form-label">小程序开关</label>
                                <div class="layui-input-inline">
                                    <input type="checkbox" name="AppletSwitch" id="AppletSwitch" lay-skin="primary">
                                </div>
                               
                            </div>
                            <div class="layui-form-item active">
                                <label class="layui-form-label">小程序模板编码</label>
                                <div class="layui-input-inline">
                                    <input type="text" class="layui-input" id="AppletTemplateId" name="AppletTemplateId" placeholder="小程序订阅消息模板ID" />
                                </div>
                            </div>
                            <div class="layui-form-item active">
                                <label class="layui-form-label">小程序模板</label>
                                <div class="layui-input-block">
                                    <input class="layui-input" id="AppletTemplateParams" name="AppletTemplateParams" placeholder="小程序参数date2对应的值订单时间用&隔开对应,例如：date2&{订单时间},date3&{出诊时间}" />
                                </div>
                            </div>
                            <div class="layui-form-item active">
                                <label class="layui-form-label">小程序标题</label>
                                <div class="layui-input-block">
                                    <input type="text" style="width: 499px;" class="layui-input" id="AppletTitle" name="AppletTitle" placeholder="您好，您已成功预约了视频问诊，请立即前往候诊大厅。" />
                                </div>
                            </div>
                            <div class="layui-form-item active">
                                <label class="layui-form-label">小程序备注</label>
                                <div class="layui-input-block">
                                    <input type="text" style="width: 499px;" class="layui-input" id="AppletRemark" name="AppletRemark" placeholder="立即进入" />
                                </div>
                            </div>
                            <div class="layui-form-item active">
                                <label class="layui-form-label">小程序链接</label>
                                <div class="layui-input-block">
                                    <input type="text" style="width: 499px;" class="layui-input" id="AppletUrl" name="AppletUrl"
                                           placeholder="/pages/videomedical/writemedicaldata/askreply/index?docId={医生编号}&contentId={问题单编号}&patientId={患者编号}" />
                                </div>
                            </div>
                        </div>
                    </fieldset>
   
   
                    <fieldset class="layui-elem-field">
                        <legend>APP通知推送</legend>
                        <div class="layui-field-box">
                            <div class="layui-form-item active">
                                <label class="layui-form-label">推送开关</label>
                                <div class="layui-input-inline">
                                    <input type="checkbox" name="PushSwitch" id="PushSwitch" lay-skin="primary">
                                </div>
                               
                            </div>
                        </div>
                        <div class="layui-form-item active">
                            <label class="layui-form-label">推送模板ID</label>
                            <div class="layui-input-inline">
                                <input type="text" class="layui-input" id="PushTemplateId" name="PushTemplateId" placeholder="消息推送模板ID" />
                            </div>
                        </div>
                    </fieldset>
   
                   
                    <div class="layui-form-item layui-hide">
                        <input type="button" lay-submit lay-filter="btnSubmit" id="btnSubmit" value="确认">
                    </div>
                </div>
            </div>
        </form>
   </div>
</script>

<script type="text/html" id="dlg_msgpushform">
    <div class="layui-fluid box">
        <form class="layui-form" lay-filter="formPushTemplate" id="formPushTemplate" style="padding: 0px 0px 0 0;">
            <div class="layui-card">
                <div class="layui-card-body box">
                    <div class="layui-form-item layui-hide">
                        <input type="text" id="TempId" name="TempId" value="0" />
                        <input type="text" id="PushTemplateId" name="PushTemplateId" value="0" />
                        <input type="text" id="WorkId" name="WorkId" value="0" />>
                    </div>
                    <div class="layui-form-item active">
                        <label class="layui-form-label"><i style="color:red;">*&ensp; </i>推送应用ID</label>
                        <div class="layui-input-inline">
                            <input type="text" required lay-verify="required" class="layui-input" name="AppId" />
                        </div>
                        <label class="layui-form-label"><i style="color:red;">*&ensp; </i>包名</label>
                        <div class="layui-input-inline">
                            <input type="text" required lay-verify="required" class="layui-input" name="PackageName" />
                        </div>
                    </div>
                    <div class="layui-form-item active">
                        <label class="layui-form-label"><i style="color:red;">*&ensp; </i>模板标题</label>
                        <div class="layui-input-block">
                            <input type="text" required lay-verify="required" class="layui-input" name="Title" />
                        </div>
                    </div>
                    <div class="layui-form-item active">
                        <label class="layui-form-label"><i style="color:red;">*&ensp; </i>模板内容</label>
                        <div class="layui-input-block">
                            <textarea style="width: 499px; height: 119px;" required lay-verify="required" type="text"
                                      name="Body" placeholder="例如：您有一条新消息，请及时查看"></textarea>
                        </div>
                    </div>
                    <div class="layui-form-item active">
                        <label class="layui-form-label">通知后续动作</label>
                        <div class="layui-input-block">
                            <input class="layui-input" name="ClickType" placeholder="目前支持intent、url、payload、startapp" />
                        </div>
                    </div>
                    <div class="layui-form-item active">
                        <label class="layui-form-label">自定义消息</label>
                        <div class="layui-input-block">
                            <input class="layui-input" name="Payload" placeholder="" />
                        </div>
                    </div>
                    <div class="layui-form-item active">
                        <label class="layui-form-label">特定页面</label>
                        <div class="layui-input-block">
                            <input type="text" class="layui-input" name="Intent" placeholder="示例：intent:#Intent;component=你的包名/你要打开的 activity 全路径;S.parm1=value1;S.parm2=value2;end" />
                        </div>
    
                    </div>
                    <div class="layui-form-item active">
                        <label class="layui-form-label">通知打开链接</label>
                        <div class="layui-input-block">
                            <input class="layui-input" name="Url" placeholder="点击通知打开链接" />
                        </div>
                    </div>
                    <div class="layui-form-item active">
                        <label class="layui-form-label">角标数字</label>
                        <div class="layui-input-block">
                            <input type="text" class="layui-input" name="BadgeAddNum" placeholder="" value="0" />
                        </div>
                    </div>
                    <div class="layui-form-item layui-hide">
                        <input type="button" lay-submit lay-filter="btnSubmit" id="btnSubmit" value="确认">
                    </div>
                </div>
            </div>
        </form>
    </div>
</script>